<article id="wikiArticle">
<div> <div class="blockIndicator nonStandard nonStandardHeader">
<p><strong><span class="icon-only-inline" title="This API has not been standardized."><i class="icon-warning-sign"> </i></span> 非标准</strong><br/>
      该特性是非标准的，请尽量不要在生产环境中使用它！</p>
</div></div>
<p><code><strong>toSource()</strong></code> 方法返回代表该对象源码的字符串。</p>
<p>该方法通常由JavaScript内部调用。</p>
<h2 id="Syntax">Syntax</h2>
<pre><code class="language-javascript"><var>Symbol</var>.toSource()

var sym = Symbol()
sym.toSource()</code></pre>
<h2 id="Description">Description</h2>
<p><code>toSource</code>方法返回以下值：</p>
<p>对于内建<code>Symbol对象</code>, <code>toSource</code> 返回以下字符串，表明源代码不可见：</p>
<pre><code class="language-js">"function Symbol() {
   [native code]
}"</code></pre>
<p>对于<code>Symbol实例</code>, <code>toSource</code> 返回代表源码的字符串。</p>
<pre><code  class="language-javascript">"Symbol()"</code></pre>
<h2 id="Specifications">Specifications</h2>
<p>还未成为任何标准的一部分</p>
<h2 id="Browser_compatibility">Browser compatibility</h2>
<p></p><div class="blockIndicator warning"><strong><a class="external" href="https://github.com/mdn/browser-compat-data" rel="noopener">We're converting our compatibility data into a machine-readable JSON format</a></strong>.
            This compatibility table still uses the old format,
            because we haven't yet converted the data it contains.
            <strong><a class="new" href="/zh-CN/docs/MDN/Contribute/Structures/Compatibility_tables" rel="nofollow">Find out how you can help!</a></strong></div>
<div class="htab">
<a id="AutoCompatibilityTable" name="AutoCompatibilityTable"></a>
<ul>
<li class="selected"><a>Desktop</a></li>
<li><a>Mobile</a></li>
</ul>
</div><p></p>
<div id="compat-desktop">
<table class="compat-table">
<tbody>
<tr>
<th>Feature</th>
<th>Chrome</th>
<th>Firefox (Gecko)</th>
<th>Internet Explorer</th>
<th>Opera</th>
<th>Safari</th>
</tr>
<tr>
<td>Basic support</td>
<td><span style="color: #f00;">未实现</span></td>
<td><a href="/en-US/Firefox/Releases/36" title="Released on 2015-02-24.">36.0</a> (36.0)</td>
<td><span style="color: #f00;">未实现</span></td>
<td><span style="color: #f00;">未实现</span></td>
<td><span style="color: #f00;">未实现</span></td>
</tr>
</tbody>
</table>
</div>
<div id="compat-mobile">
<table class="compat-table">
<tbody>
<tr>
<th>Feature</th>
<th>Android</th>
<th>Chrome for Android</th>
<th>Firefox Mobile (Gecko)</th>
<th>IE Mobile</th>
<th>Opera Mobile</th>
<th>Safari Mobile</th>
</tr>
<tr>
<td>Basic support</td>
<td><span style="color: #f00;">未实现</span></td>
<td><span style="color: #f00;">未实现</span></td>
<td>36.0 (36.0)</td>
<td><span style="color: #f00;">未实现</span></td>
<td><span style="color: #f00;">未实现</span></td>
<td><span style="color: #f00;">未实现</span></td>
</tr>
</tbody>
</table>
</div>
<h2 id="See_also">See also</h2>
<ul>
<li><a href="Reference/Global_Objects/Object/toSource" title="toSource()方法返回一个表示对象源代码的字符串。"><code>Object.prototype.toSource()</code></a> <span class="icon-only-inline" title="This API has not been standardized."><i class="icon-warning-sign"> </i></span></li>
</ul>
</article>